<?php abstract class modInvoices implements ifModule {
	public static function Process (array $Args, array $Files) {
		if (isset ($Args ['id']) and isset ($Args ['delete-confirm'])) {

Debug::DumpKill ($Args);

		}


		if (isset ($Files ['invoice'])) {
			if (isset ($Files ['invoice']['error']) and UPLOAD_ERR_OK === ($Error = $Files ['invoice']['error'])) {
				XReq::Record (ParseInvoice ($Files ['invoice']['tmp_name']));
			} else XReq::Record ("Uploading file error value: <big>$Error</big>. The meaning can be found <a href='http://ru.php.net/manual/en/features.file-upload.errors.php'>on PHP site</a>.");
		}
	}
	public static function Form ($ID = NULL) { ?>
		<?php if ($ID) { ?>
			<form action="" method="post">
				<input type="hidden" name="<?php HTML::E (__CLASS__) ?>[id]" value="<?php HTML::E ($ID) ?>"/>
				<button type="submit" name="Views[next]" value="invoice">Cancel</button>
				<button type="submit" name="<?php HTML::E (__CLASS__) ?>[delete-confirm]" value="yes">Confirm</button>
		<?php } else { ?>
			<form action="" method="post" enctype="multipart/form-data">
				<label>Select an invoice file: <input type="file" name="<?php HTML::E (__CLASS__) ?>[invoice]"/></label>
				<button type="submit">Upload</button>
		<?php } ?>
		</form>
<?php }
} ?>